const {request}=require('./request')



//写各种接口封装方法
module.exports={

   //封装轮播图接口
   getGoodsBanner(type='index') {
     return request('/banner/list','GET',{type})
   },

   //封装商品分类接口
   getGoodsCate() {
     return request('/shop/goods/category/all','GET')
   },
   //封装商品列表接口
   /**
    * 
    * @param {Object} data   
    */
   getGoodsList(data) {
     return request('/shop/goods/list/v2','POST',data)
   },
   //检测token是否有效
   checkTokenApi(token) {
     return request('/user/check-token','GET',{token})
   },
   //自动登录注册接口
   autoAuthorize(code) {
     return request('/user/wxapp/authorize','POST',{code})
   },
   //读取用户详细信息接口
   getUserDetail(token) {
     return request('/user/detail','GET',{token})
   },
   //更新用户信息接口
   /**
    * 
    * @param {Object} data  { city:城市,nick:昵称,province:省份,avatarUrl:头像,gender:性别,token:token }
    */
   updateUserInfoApi(data) {
     return request('/user/modify','POST',data)
   }



}